package com.rd.student.ruanjian.class4.zhangrui;

import java.util.LinkedList;

public class LinkedListText {
    public static void main(String[] args) {
        LinkedList linkedList = new LinkedList();
        Student s1 = new Student("王星凯", "软件四班", "软件工程","twob",32);
        Student s2 = new Student("高艺铭", "软件四班", "软件工程","恋爱脑",18);
        Student s3 = new Student("张睿", "软件四班", "软件工程","没描述",21);
        Student s4 = new Student("李春泉", "软件四班", "软件工程","没描述",20);
        Student s5 = new Student("周子贺", "软件四班", "软件工程","没描述",18);
        Student s6 = new Student("杜航", "软件四班", "软件工程","没描述",22);
        Student s7 = new Student("柏云耀", "软件四班", "软件工程","没描述",22);
        linkedList.add(s1);
        linkedList.add(s2);
        linkedList.add(s3);
        linkedList.add(s4);
        linkedList.add(s5);
        linkedList.add(s6);
        linkedList.add(s7);


        for (int i = 0; i < 7; i++) {
            System.out.println(linkedList.get(i));

        }
    }

    //方法 根据班级返回

    static class Student {
        private String name;
        private String grade;
        private String major;
        private String description;
        private int age;


        public Student(String name, String grade, String major, String description, int age) {
            this.name = name;
            this.grade = grade;
            this.major = major;
            this.description = description;
            this.age = age;
        }

        @Override
        public String toString() {
            return "Student{" +
                    "name='" + name + '\'' +
                    ", grade='" + grade + '\'' +
                    ", major='" + major + '\'' +
                    ", description='" + description + '\'' +
                    ", age=" + age +
                    '}';
        }
    }
}
